package drawables;

import java.awt.Graphics;

import javafx.scene.canvas.GraphicsContext;

public abstract class Drawable {
	protected int x;
	protected int y;
	
	protected int width;
	protected int height;
        protected boolean selected=false;

        public boolean isSelected() {
            return selected;
        }

        public void setSelected(boolean selected) {
            this.selected = selected;
        }
	
        
        
        
        
	private void addToDrawables(){
		DrawableManager.get().add(this);
	}
	
	public Drawable(){
		//addToDrawables();
	}
	
	public Drawable(int x , int y){
		this.x = x;
		this.y = y;
		
		//addToDrawables();
	}
	
	public int getX(){
		return x;
	}
	
	public int getY(){
		return y;
	}
	
	public void setX(int x) {
		this.x = x;
	}
	
	public void setY(int y) {
		this.y = y;
	}
	
	public boolean contains(int x , int y){
		if(x > this.x && x < this.x + this.width && y > this.y && y < this.y + this.height)
			return true;
		return false;
	}
	
	public void onLeftClick(int x , int y){}
	
	public void onRightClick(int x , int y){}
	
	public void onDrag(int x , int y){}
	
	public void onDrop(Drawable d){}
	
	public void onDropReceived(Drawable d){}
	
        public void onDelete(){}
	
        public abstract Type getType();
        
	public abstract void paint(Graphics g);	
	public abstract void paint(GraphicsContext g);	

}
